package test_achieve.web.scenes;
import constant.Pm;
import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import test_achieve.web.Oneself;
import test_achieve.web.OrderMain;

/**
 * Created by chenkuo on 2017/10/23.
 */
public class Appoint {

    /**预约单场景封装*/

    /**前置：无
     * 步骤：登录，切换城市，详情输入，下单*/

    @Given("^w用户下了一个一取一投预约单：(.+)：(.+)：(.+)：(.+)：(.+)：(.+)：(.+)：(.+)：(.+)：(.+)：(.+)：(.+)$")
    public void w用户下了一个一取一投预约单(String username,String city,String sendAdress,String sendName,String sendMobile,String receiveAddress,String receiveName,String receiveMobile,String time,String weight,String goodsName,String remark) throws Throwable {
        OrderMain webmain = new OrderMain();
        Basic basic = new Basic();
        OneToOne oneToOne = new OneToOne();
        basic.w登录并切换城市( username, city);
        Oneself me = new Oneself();
        me.w进入在线下单界面();
        oneToOne.w输入一取一投订单信息( sendAdress, sendName, sendMobile, receiveAddress, receiveName, receiveMobile, weight, goodsName, remark);
        webmain. w选择预约取件取件时间(time);
        webmain.wClickNext();
        webmain. wSubmitOrder();
    }

    @Given("^w用户下了一个一取一投预约单"+ Pm.p6)
    public void w用户下了一个一取一投预约单(String username,String sendAdress,String receiveAddress,String weight,String goodsName,String remark)throws Throwable {
        w用户下了一个一取一投预约单( username, null, sendAdress, null, null, receiveAddress, null, null, null,weight, goodsName, remark);
    }
    @Given("^w用户下了一个一取一投预约单"+Pm.p5)
    public void w用户下了一个一取一投预约单(String username,String city,String sendAdress,String receiveAddress,String time) throws Throwable {
        w用户下了一个一取一投预约单( username, city, sendAdress, null, null, receiveAddress, null, null,time, null, null, null);
    }

    @Given("^w用户下了一个一取一投预约单"+Pm.p4)
    public void w用户下了一个一取一投预约单(String username,String city,String sendAdress,String receiveAddress) throws Throwable {
        w用户下了一个一取一投预约单( username, city, sendAdress, null, null, receiveAddress, null, null,null, null, null, null);
    }
}
